Control Unit

ABSTRACT

Upon initiation of a initiation processing by a task management, reference is made to a initiation table for processing of initiation, and processing of measurement is performed by an input measurement processing in response to the preset timing. Then the input value is stored in a input value storage buffer. When an application program is acquired, an input value acquisition processing is initiated, the input value is from the buffer, and is transferred to the application program. When the application program is set, an output value updating is initiated, the output value having been transferred from the application program is updated, and the result is stored in an output value storage buffer. Further, output processing means is initiated in response to the timing preset on the initiation table and an output value is outputted from the output value storage buffer.

This application is a continuation of U.S. patent application Ser. No.11/504,628 filed Aug. 16, 200, which claims priority to Japanese patentapplication Serial No. JP1995/40794 filed Aug. 17, 2005, the entiredisclosures of which are herein incorporated in their entireties.

CLAIM OF PRIORITY

The present application claims priority from Japanese application serialno. 1995-40794, filed on Aug. 17, 2005, the content of which is herebyincorporated by reference into this application.

FIELD OF THE INVENTION

The present invention relates to a control unit for controlling anactuator based on external states through a sensor or network,particularly to a control unit for initiating processing synchronouswith an event.

BACKGROUND OF THE INVENTION

A vehicle engine control unit controls the amount of fuel and injectiontiming, based on the input such required. In recent years,standardization of vehicle control software is processing mainly inEurope. One example is found in the OSEK-OS disclosed in OSEK/VDXVersion, OSEK/VDX Operating System, which is the code for a real timeoperating system.

In the description of Japanese Patent Laid-open No. 2004-192541 andJapanese Patent Laid-open No. Hei 7 (1995)-407942, the softwareincorporated in the control unit is classified into an applicationprogram and an interface program. The interface program transfers theinformation of the input/output signal connected to a control unit overto the application program, and does not require a change of theapplication program in response to hardware modification.

SUMMARY OF THE INVENTION

In the aforementioned interface program, the input value to betransferred to the application is not restricted to the input signalvalue connected to the control unit when the input interface has beencalled. Namely, when the input value acquired through the inputinterface is a value measured and stored at a predetermined time of anevent. In the output, it does not necessarily follow that the outputsignal connected to the control unit is outputted when the outputinterface has been called. To be more specific, the output value setthrough the output interface is the value outputted from the controlunit at a predetermined event.

The timing for measuring the input signal in the interface program andthe timing for outputting the output signal are incorporated at the timeof developing the interface program. Accordingly, when theaforementioned timing is to be changed, the interface program per semust be modified.

The object of the present invention is to solve the aforementioned priorart problems and to provide a control unit that can be easily changedthe timing, without having to modify the interface program.

The following describes the structure of the control unit of the presentinvention achieving the aforementioned object:

The control unit of the present invention comprises:

storage means for storing an input value from the outside or an outputvalue to the outside separately for each input/output signal;

input means for measuring the input signal from the outside and updatingthe input value stored in the storage means;

output means for outputting an output signal to the outside in accordingwith the value stored in the storage means;

input value acquisition means for transferring the input value stored inthe storage means to an application program;

output value updating means for storing the output value transferredfrom the application program into said storage means;

initiation means for initiating said input means and output means; and

initiation timing storage means for storing the initiation timing,

wherein said input means and output means are initiated by saidinitiation means in response to the timing stored on said initiationtiming storage means.

Alternatively, the control unit of the present invention ischaracterized in that the input means and output means are initiated inresponse to the timing set on the aforementioned application program,without having the aforementioned initiation means.

The present invention provides an advantage of easy modification of thetiming of measuring the input signal connected to the control unit orthe output signal output timing.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 shows the function block diagram representing a control unit asthe first embodiment of the present invention;

FIG. 2 is a flow chart representing the flow of 10-msec processing;

FIG. 3 is a schematic diagram representing the initiation table;

FIG. 4 is a flow chart representing the initiation processing;

FIG. 5 is a flow chart representing the digital input in inputprocessing;

FIG. 6 is a flow chart representing the analog input in inputprocessing;

FIG. 7 is a flow chart representing the communication input in inputprocessing;

FIG. 8 is a flow chart representing the frequency input in inputprocessing;

FIG. 9 is a flow chart representing the digital output in outputprocessing;

FIG. 10 is a flow chart representing the analog output in outputprocessing;

FIG. 11 is a flow chart representing the communication output in outputprocessing;

FIG. 12 is a flow chart representing the frequency output in outputprocessing;

FIG. 13 is a schematic diagram showing the input value storage buffer;

FIG. 14 is a schematic diagram showing the output value storage buffer;

FIG. 15 is a flow chart representing the digital input in input valueacquisition processing;

FIG. 16 is a flow chart representing the analog input in input valueacquisition processing;

FIG. 17 is a flow chart representing the communication input in inputvalue acquisition processing;

FIG. 18 is a flow chart representing the frequency input in input valueacquisition processing;

FIG. 19 is a flow chart representing the digital output in the outputvalue updating processing;

FIG. 20 is a flow chart representing the analog output in the outputvalue updating processing;

FIG. 21 is a flow chart representing the communication output in theoutput value updating processing;

FIG. 22 is a flow chart representing the frequency output in the outputvalue updating processing;

FIG. 23 is a flow chart representing the 10-msec task processing;

FIG. 24 is a flow chart representing the 10-msec application processing;

FIG. 25 is a timing chart representing the operation of inputprocessing;

FIG. 26 is a timing chart representing the operation of outputprocessing; and

FIG. 27 is a flow chart representing the processing wherein theprocessing of timing is called by the application program.

DESCRIPTION OF THE PREFERRED EMBODIMENTS

The control unit of the present invention has implementedinterrupt-synchronous task initiation of reduced OS overhead byimproving the software, without having to modify the hardwareconfiguration or OS. The following describes a plurality of examples ofthe present invention with reference to drawings:

Embodiment 1

FIG. 1 shows the function block diagram representing a control unit asthe first embodiment of the input/output control unit of the presentinvention. A control unit 1 is connected with a sensor 2 and an actuator3, and is also connected with another control unit 5 via the network 4.More than one sensor 2, actuator 3 and the control unit 5 can beconnected to the control unit 1.

The control unit 1 is composed of a memory 11, CPU 12 and I/O module 13.The I/O module 13 is connected with the sensor 2, actuator 3 and network4, and is used to capture an input value or to output data. The CPU 12executes the program stored in the memory 11.

The memory 11 contains a task management 120 for managing the taskinitiation, an application program 111, input value acquisitionprocessing 112 for transferring the input value to the applicationprogram, and output value updating 113. The memory 11 also contains aninput value storage buffer 114 for storing the input value to betransferred to the application program, an output value storage buffer115 for storing the output value transferred from the applicationprogram, an input measurement processing 116 for measuring the inputvalue to be transferred to the application program, and an outputprocessing 117 for outputting the output value. The memory 11 alsocontains an initiation table 118 that stores what processing isinitiated in a predetermined event by an initiation processing 119 forinitializing the input value measurement and output processing. Theinitiation table 118 can be set and modified by the initiation tablesetting means 6. In the setting or modification of the initiation table118 by the initiation table setting means 6, the source filecorresponding to the initiation table 118 prior to storage into thememory 11 is modified and the modified initiation table 118 is stored atthe time of storage into stored in the memory 11.

FIG. 2 is an explanatory diagram representing the flow of the processingof a program in the control unit. It explains the flow of the processingof the program stored in the control unit 1 with reference to an exampleof the 10-msec task as one of the tasks 121 to be initiated by the taskmanagement 120.

In part of the I/O module 13, the task management 120 is initiated by atimer (not illustrated). The task management 120 refers to the 10-msectiming in this case, and initiates the 10-msec task 121. The 10-msectask includes 10-msec event pre-processing 1211, 10-msec application112, and 10-msec event post-processing 1213, as shown in FIG. 23.

The 10-msec application 112 initiates the 10-msec event pre-processing1211. The 10-msec event pre-processing 1211 initiates the initiationprocessing 119. The initiation processing 119 will be described later.

The initiation processing 119 initiates the input measurement processing116 registered in the 10-msec before timing of the initiation table 118.The update_in1 is executed in the processing 11651 of the input valuemeasurement 116, and update_in2 is executed in the processing 11652.

Then the 10-msec application 112 is initiated. Input value acquisitionprocessing 1212 is initiated in the 10-msec application to acquire in1and in2. The get_in1 is executed in processing 121251, and get_in2 isexecuted in processing 122152.

After executing a predetermined processing, the application initiatesthe output value updating 113, and set_out1 is executed in processing11351.

Upon termination of the 10-msec application, the 10-msec eventpost-processing 1213 is initiated. The output processing 117 registeredin the 10-msec after timing of the initiation table 118 is executed inthe 10-msec event post-processing. The update_out1 is executed inprocessing 11751. Upon termination of the 10-msec event post-processing,the system goes back to the 10-msec task, and the 10-msec taskterminates.

The following describes the configuration and function of the componentsstored in the memory 11 of FIG. 1.

FIG. 3 shows the configuration of the initiation table 118. In thisexample, four items in the first half of the event are concerned withsynchronization in time, while the two in the latter half are related tosynchronization in engine rotation. Input signals are made up of inputsignal 1, input signal 2, input signal 3 and input signal 4, whileoutput signals are made up of output signal 1, output signal 2, outputsignal 3 and output signal 4. The input signal 1 is measured at thetiming of 10-msec pre-processing initiation. The input signal 2 ismeasured at the timing of 10-msec pre-processing. The input signal 3 ismeasured at the timing of 20-msec pre-processing. The input signal 4 ismeasured at the timing of engine REF timing pre-processing. The outputsignal 1 is outputted at the timing of 10-msec post-processing. Theoutput signal 2 is outputted at the timing of 20-msec post-processing.The output signal 3 is outputted at the timing of 20-msecpost-processing. The output signal 4 is outputted at the timing ofengine REF timing post-processing.

In the present Embodiment, the initiation timing of each event, and thehead address for measurement corresponding to the name of the signal tobe inputted and measured, or the head address for output processingcorresponding to the signal name to be outputted are stored in theinitiation table 118 in advance. The input measurement processing 116for measuring the input signal in response to the pre-processing andpost-processing at each timing, and the output processing 117 foroutputting the output signal are executed for each signal.

FIG. 4 is a flow chart representing the initiation processing 119, whichwill be explained with reference to 10-msec pre-processing as anexample. The initiation processing 119 is initiated by 10-msec eventpre-processing and 10-msec event post-processing in the example of FIG.2 In processing 1191, timing at this moment is acquired. Processing 1192executes signal processing. In the first plate, the input measurementprocessing update_in1 of the input signal in1 registered in theinitiation table 118 is implemented. In decision processing 1193, adecision is made to see whether or not there is next signal processing.Since the input processing in2 is registered, the system goes back toprocessing 1192 to execute the input measurement processing update_in2of the input signal in2. In decision processing 1193, processingterminates since the next signal processing is not registered.

The initiation processing 119 is applies to the input measurement andoutput processing of other signals in the same manner. To be morespecific, the input processing update_in3 of the input signal in3 isinitiated in the 20-msec pre-processing, and update_out2 as the outputprocessing of the output signal out2 and update_out3 as the outputprocessing of the output signal out3 are initiated in the 20-msecpost-processing. The input measuring update_in4 of the input signal in4is initiated in the pre-process of engine REF, and the output measuringupdate_out4 of the output signal out4 is initiated in the post-processof engine REF.

FIG. 5 is a flow chart representing the input processing 1161.Processing 11611 measures the input value in1. For example, if the inputsignal is a digital input signal, the value measured is inputted intothe input value storage buffer 114 for updating the stored value.

FIG. 6 shows the processing of input measurement for analog input.Processing 11621 measures the input value in2, and startsanalog-to-digital conversion. Processing 11622 updates the input valuestorage buffer 114, subsequent to analog-to-digital conversion.

FIG. 7 shows the processing of input measurement by another controlunit. It represents processing of the data received via the network fromanother control unit is through communication. Processing 11631 executesbit-based conversion of the received data (input value in3) to updatethe input value storage buffer 114. For example, when the data in3multiplied by 2 to the power of 3 is used by the application, the valuein3 is shifted left three bit positions, and the result is stored in theinput value storage buffer 114.

FIG. 8 shows the processing of input measurement for frequency input.Processing 11641 measures the frequency (input value in4), and inputsthe result of unit-based conversion of the frequency value into theinput value storage buffer 114 for updating.

FIG. 9 is a flow chart representing the processing of output 11711.Processing 11711 acquires the value (out1_buff) of the output valuestorage buffer 115 and outputs the result of port output conversion tothe output signal. For example, if the output signal is a digital outputsignal, the port value of out1 is outputted in response to the ON/OFFvalue stored in the output value storage buffer. For example, if thevalue corresponding to the ON operation is 0, and that corresponding tothe OFF is 1, 0 will be outputted if the ON is specified, and 1 will beoutputted if the OFF is specified.

FIG. 10 shows the case of an analog signal. In processing 11721, theanalog value (duty of out2) is outputted in response to the result ofconverting the register set value of the value (out2_buff) of the outputvalue storage buffer 115.

FIG. 11 shows the processing of transmitting the output value to thenetwork. Processing 11731 updates the transmission data (out3_buffvalue) to a value corresponding to the out3 bit. For example, if two-bitdata from the least significant position of the transmission bufferout3_buff is the data corresponding to the out3, only the two-bit datais updated to the value of out3.

FIG. 12 shows the frequency output. Processing 11741 outputs thefrequency of the out4 in response to the value (out4_buff) of the outputvalue storage buffer 115. For example, if the frequency is set at 1 kHz,a 1 kHz-bit pulse is outputted.

FIG. 13 represents the configuration of the input value storage buffer114. The measured value of the in1 is stored in the in1_buff storagebuffer 1141. The measured value of the in2 is stored in the in2_buffstorage buffer 1142. The measured value of the in3 is stored in thein3_buff storage buffer 1143. The measured value of the in4 is stored inthe in4_buff storage buffer 1144.

FIG. 14 represents the configuration of the output value storage buffer115. The out1 is stored in the out1_buff storage buffer 1151. The out2is stored in the out2_buff storage buffer 1152. The out3 is stored inthe out3_buff storage buffer 1153. The out4 is stored in the out4_buffstorage buffer 1154.

FIGS. 15 through 18 are flow charts representing the input valueacquisition processing 112. Processing 1121 of FIG. 15 returns theinformation in1_buff stored in the input value storage buffer 114. Theinformation to be transferred is the result of unit-based conversionperformed in conformity to the specifications described in theinterface.

Processing 1122 of FIG. 16 corresponds to the input value acquisitionprocessing of the in2. Processing 11221 returns the result of convertingthe value of the in2_buff based on a predetermined unit.

Processing 1123 of FIG. 16 corresponds to the input 5 value acquisitionprocessing of the in3. Processing 11231 returns the value of in3_buffdirectly to the application program 111.

Processing 1124 of FIG. 18 corresponds to the input acquisition of thein4. Processing 11241 returns the value of in4_buff directly.

FIGS. 19 through 22 are flow charts representing the output valueupdating 113. FIG. 19 shows the processing of updating the output valueof the out1. Processing 11311 updates the value out1_val transferredfrom the application program 111, directly to the out1_buff.

FIG. 20 shows the processing of updating the output value out2.Processing 11321 updates the value out2_val transferred from theeapplication program 111, directly to the out2_buff.

FIG. 21 shows the processing of updating the output value out3.Processing 11331 converts the value out3_val transferred from theapplication program 111, according to a predetermined conversion formulaand updates the result of conversion to the out3_buff.

FIG. 22 shows the processing of updating the output value out4.Processing 11341 converts the value out4_val transferred from theapplication program, according to a predetermined conversion formula andupdates the result of conversion to the out4_buff.

FIG. 23 indicates a 10-msec task processing flow. Processing 1211 by the10-msec task described with reference to FIG. 2 initiates the 10-msecapplication. Then processing 1213 initiates the 10-msec eventpost-processing. Initiation processing 119 is initiated in processing1211 and 1213, as described above.

FIG. 24 is a flow chart representing the appl_(—)10-msec by the 10-msecapplication 1212 as one of the application programs 111. Processing 8221acquires the value of in1 through the get_in1, and updates it toin1_val. Processing 8212 acquires the value of in2 through the get_in2,and updates it to in2_val. Processing 8213 executes 10-msec processingin response to these input values and internal states, and updates theout1_val. Processing 8214 sets the out1_val to the output value storagebuffer 115 through the set_out1.

The following describes the input operation in the present Embodiment.FIG. 25 shows the input 1 and timing chart related thereto. Timing 9111and timing 9112 refer to 10-msec event. Timing 9113 and timing 9114refer to the timing when update_in1 (10-msec pre-processing) isexecuted. The appl_(—)10 m is executed at timing 9115 and 9116.Processing 9117 and 9118 update the in1_buff. Processing 9119 and 9120updates the in1_val.

FIG. 26 shows the output signal out1 and timing chart related thereto.Timing 9511 and timing 9512 refer to 10-msec event. Timing 9513 andtiming 9514 refer to the timing when set_out1 (10-msec post-processing)is executed. The out1_buffer is updated at this timing. The subsequenttiming refers to the timing when update_out1 is called. Processing 9117and 9118 update the out1_buff. Processing 9519 and 9520 updates theoutput signal out1 in conformity to the value of out1_buff.

In the present embodiment, timing for measurement and output can bechanged easily by adjusting settings of the initiation table 118,without having to change the interface software. For example, when themeasurement timing of the input signal in1 is to be changed from the10-msec pre-processing to the 20-msec pre-processing, the update_in1 ofthe initiation table 118 should be shifted from the 10-msecpre-processing to the 20-msec pre-processing. No other change isnecessary.

The present invention is applicable to a control unit constituting acontrol system required to provide real-time processing, as inautomotive control. It easily changes the timing for the measurement ofthe input value of the external signal connected to the control unit aswell as the timing for outputting.

Embodiment 2

In Embodiment 1, the input measurement processing 116 and outputprocessing 117 are initiated by initiation processing 119. They can alsobe initiated by the application program 111.

The control unit of the present embodiment includes: storage means forstoring an input value from the outside or an output value to theoutside separately for each input/output signal; input means formeasuring the input signal from the outside and updating the input valuestored in the storage means; and output means for outputting the outputsignal to the outside in response to the output value stored in thestorage means. This control unit further contains: input valueacquisition means for transferring to an application program the inputvalue stored in the storage means; and output value updating means forstoring into the storage means the output value transferred from theapplication program. Further, the input means and output means areinitiated in response to the timing preset in the aforementionedapplication program.

In the conventional art, acquisition of the input value by the inputvalue acquisition processing 112 and updating of the output value by theoutput value updating 113 have been implemented, but the timing formeasuring the input value measurement and outputting the output valuehas been fixed. By contrast, the Embodiment 2 allows the initiationtiming to be changed as desired, through direction description of theinput measurement processing 116 and output processing 117 by theapplication program, although there is no initiation means describedwith reference to the Embodiment 1. To put it more specifically, theprocessing 9117 and processing 9118 can be called from the application,as is apparent from FIG. 25.

FIG. 27 is a flow chart representing the 10-msec application processingwherein the processing of timing is called by the application program.Processing 8215 measures the input value in1. Processing 8211 receivesthe in1 and stores it in the int_val. Processing 8213 executes theapplication processing. Processing 8214 sets the out1 calculated in theprocessing 8213. Processing 8216 outputs the out1. In the presentexample, the in2 is a value having been obtained by measurement at apredetermined timed interval. Measurement processing is not called bythe application program.

In the present embodiment, the timing for measurement can be changedwithout having to change the interface software. This description isalso applicable to the output process: The output timing can be changedby calling the update_out1 from the application program 111, withouthaving to change the interface software.

The present invention is applicable to a control unit constituting acontrol system required to provide real-time processing, as inautomotive control. It easily changes the timing for the measurement ofthe input value of the external signal connected to the control unit aswell as the timing for outputting.

Embodiment 3

The following describes the case wherein the aforementioned embodiment 1is applied to a vehicle engine control. The vehicle engine control unitof the present invention includes: storage means for storing an inputvalue from a sensor and others or an output value to an engine controlunit separately for each input/output signal; input means for measuringthe input from the sensor and others, and updating the input valuestored in the storage means; and output means for outputting an outputsignal to the engine control unit in according with the value stored insaid storage means. This vehicle engine control unit also includes:input value acquisition means for transferring the input value stored insaid storage means to an engine control program; output value updatingmeans for storing the output value transferred from the engine controlprogram into the storage means; initiation means for initiating saidinput means and output means, and initiation timing storage means forstoring the initiation timing. Further, the input means and output meansare initiated by said initiation means in response to the timing storedon said initiation timing storage means.

According to the above description, the input signal in1 of theembodiment 1 refers to a digital input and corresponds to the ignitionswitch or the like. The digital output signal out1 corresponds to apower train relay or the like. The input signal in2 is an analog inputand corresponds to a water temperature or oxygen sensor.

Input signal in3 is the information received from another control unitthrough communication, and corresponds to vehicle speed or gear position(e.g. first gear or neutral position), for example. The output signalout3 is the information to be sent to another control unit, andcorresponds to the state of the control unit (e.g. engine speed), forexample. The input signal in4 is a pulse input and corresponds to thesensor outputting pulses in response to the crank angle. The outputsignal out4 is a pulse and corresponds to ignition signal or injectionsignal, for example.

In the engine control, processing is divided into two forms; theprocessing at fixed intervals and processing synchronous with enginerotation. In processing synchronous with engine rotation, the ignitioncontrol (ignition position and current application time before ignition)and injection control (injection timing and amount of injection) areperformed in response to the state of the vehicle such as engine speed.

1. A control unit comprising: storage means for storing an input valuefrom the outside or an output value to the outside separately for eachinput/output signal; input means for measuring the input signal from theoutside and updating the input value stored in the storage means; outputmeans for outputting an output signal to the outside in according withthe value stored in said storage means; input value acquisition meansfor transferring the input value stored in said storage means to anapplication program; output value updating means for storing the outputvalue transferred from said application program into said storage means;initiation means for initiating said input means and output means; andinitiation timing storage means for storing the initiation timing,wherein said input means and output means are initiated by saidinitiation means in response to the timing stored on said initiationtiming storage means.
 2. A control unit comprising: storage means forstoring an input value from the outside or an output value to theoutside separately for each input/output signal; input means formeasuring the input from the outside and updating the input value storedin said storage means; output means for outputting an output value tothe outside in according with the value stored in said storage means;input value acquisition means for transferring the input value stored insaid storage means to an application program; and output value updatingmeans for storing the output value transferred from said applicationmeans into said storage means, wherein said input means and output meansare initiated in response to the timing set in said application program.3. The control unit according to claim 1, wherein said input means andoutput means are initiated in response to the timing stored on saidinitiation timing storage means, and implements said processing for eachsignal.
 4. The control unit according to claim 1, wherein the contentsstored in said initiation timing storage means are set and stored by aninitiation timing registration means.
 5. The control unit according toclaim 2, wherein said input means is initiated by said applicationprogram.
 6. The control unit according to claim 2, wherein said outputmeans is initiated by said application program.
 7. A vehicle enginecontrol unit comprising: storage means for storing an input value from asensor and others or an output value to an engine control unitseparately for each input/output signal; input means for measuring theinput from the sensor and others, and updating the input value stored insaid storage means; output means for outputting an output signal to theengine control unit in according with the value stored in said storagemeans; input value acquisition means for transferring the input valuestored in said storage means to an engine control program; output valueupdating means for storing the output value transferred from said enginecontrol program into said storage means; initiation means for initiatingsaid input means and output means; and initiation timing storage meansfor storing the initiation timing, wherein said input means and outputmeans are initiated by said initiation means in response to the timingstored on said initiation timing storage means.